/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       mini_map_window.h

	$Header: /game/mini_map_window.h $

	$NoKeywords: $

 ************************************************************************/

#ifndef MINI_MAP_WINDOW_H_INCLUDED
#define MINI_MAP_WINDOW_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "game_window.h"
#include "mini_map_renderer.h"
#include "memory_bitmap.h"

class t_adventure_map;
class t_adventure_map_window;
// --------------------------------------------------------------------
// window to display a minimap
// --------------------------------------------------------------------
class t_mini_map_window : public t_window, public t_mini_map_renderer
{
public:
	t_mini_map_window( t_adventure_map const& map, t_screen_rect const& rect,
		               t_adventure_map_window* map_window, t_window* parent );
	t_mini_map_window( t_adventure_map const& map, t_screen_rect const& rect,
		               t_adventure_map_window* map_window, t_window* parent, int team_view );

    virtual void		 left_button_down( t_mouse_event const& event );
    virtual void		 left_button_up( t_mouse_event const& event );
    virtual void		 mouse_move( t_mouse_event const& event );
	virtual void         paint( t_paint_surface& paint_surface );
	virtual void		 resize_view(t_screen_rect const& new_size_pos);
	
protected:
	void         center_view( t_screen_point point );
	// Member functions
	virtual t_shared_ptr< t_abstract_bitmap16 > create_back_buffer( t_screen_point const & size );
	virtual void on_rect_dirtied( t_screen_rect const & dirted_rect );
	virtual void on_size_change( t_screen_rect const& rect ); // in client coordinates of parent
	virtual void on_view_level_changed( int level );
	virtual void on_view_resized( t_screen_point const & size );

	t_counted_ptr<t_adventure_map_window>	m_map_window;
	t_shared_ptr<t_memory_bitmap16>			m_back_buffer;
	bool									m_dragging;
};

#endif // MINI_MAP_WINDOW_H_INCLUDED
